home *** CD-ROM | disk | FTP | other *** search
- Path: inforamp.net!ts9-03
- From: rmorin@inforamp.net (Randy Charles Morin)
- Newsgroups: comp.lang.c++
- Subject: Re: Coding Standards
- Date: Thu, 07 Mar 96 05:16:03 GMT
- Organization: MiddleWorld SoftWare
- Message-ID: <4hlreg$6jg@sam.inforamp.net>
- References: <4hj8ek$elu@sam.inforamp.net> <4hjh5c$elk@flood.weeg.uiowa.edu>
- NNTP-Posting-Host: ts9-03.tor.inforamp.net
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <4hjh5c$elk@flood.weeg.uiowa.edu>,
- maclenna@ozone.uiowa.edu (Mark MacLennan) wrote:
- >Some of their coding standards requirements you list are actually
- >quite good, some are more dubious. Most coding standards are intended
- >as guidelines to be followed unless common sense dicticates otherwise
- >(and these deviations are documented accordingly). You should probably
- >discuss this with the company, inquire as to the intent of some of
- >the standards, rather than laugh behind their back.
- >Some of the items you list reveal your own unfamiliarity with C++,
- >which is perhaps one reason they have defined a set of C++ coding
- >standards. (Hopefully the company isn't paying you based on spelling ...)
-
- I ran a spell check on our documents and found four spelling mistakes. They
- were all yours. The words are dicticates, explicitedly, curiousity and
- inplemented. I couldn't find one spelling mistake in my document. Obviously
- your only purpose was to criticize. I went through your comments and found
- that your lack of knowledge of C++ is even worse then your spelling.
-
- >> -never use #define instead or const. What if your concerned about the
- >>mix between code space and data space.
- >Not bad advice. Pre-processor directives should be avoided if possible.
- >Better error checking too.
-
- One statement puts the data in the code section and the other puts it in the
- data section. I guess the people who made the coding standard didn't know
- that. I guess you didn't either. This is not important when you compile a
- "Hello World" example from a textbook, but it makes a difference in the 64k
- DOS world.
-
- >> -don't use conditional compilation preprocessor directives. There
- >>goes cross-platform development.
- >Huh? Since these are pre-processor commands, simply run your code
- >through the pre-processor for the particular platform your client wants
- >the software for. What's the big deal from your point-of-view? Out-of-
- >curiousity, I would inquire as to why they have this programming standard.
-
- Read the above. It says no conditional compilation preprocessor directives.
- Yet you are still using them. And do you think the contractee is going to
- accept preprocessed code? Maintenance would be very expensive.
-
- >> -optimize code only when you have a problem. So we can't optimize
- >>size in order to anticipate that code size will be a problem. First we have
- >>to experience the problem (most likely in the field).
- >Perhaps they want well-written code that they and other
- >future programmers can read rather than tricky "optimized" code.
- >The code can always be tweaked for specific hardware at a later
- >time. There is no reason that you can't write efficient code using
- >appropriate algorithms and data structures.
-
- Read the above. It says no optimizations until you have a problem. Yet you
- are still optimizing before any problems.
-
- >> -access functions are to be inline. Inline access functions defeat
- >>the purpose of having access functions.
- >This isn't clear. Having access functions inplemented inline isn't
- >such a bad idea.
-
- If an access function's data member's type changes, then what? You have to
- recompile and redistribute every module that uses the access function.
- Several thousand customers might use that accessor. Sort of defeats the
- purpose of hiding data members.
-
- From your e-mail address and your posts, I'm assuming that you are a student
- at U of Iowa. Tell me if I'm wrong. Please, before you respond, note that I
- saw your response as pompous and slow-witted. I have tried to responded to
- your pompous and slow-witted post very tactfully. Please, don't make the same
- mistake twice.
-
- Agrivar
-